// DirectionJig.h: interface for the DirectionJig class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_DIRECTIONJIG_H__69DDFEEF_EE8A_46E3_BDFA_CB6DDAD9D3F8__INCLUDED_)
#define AFX_DIRECTIONJIG_H__69DDFEEF_EE8A_46E3_BDFA_CB6DDAD9D3F8__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <dbjig.h>
#include <dbsol3d.h>
#include <gemat3d.h>
#include "GeometryEditor.h"
#include "FreeField.h"

namespace EntityJig
{
	class DllExport DirectionJig : public AcEdJig  
	{
		typedef UeGeometryEdit::DirectionEditor<AcDbEntity> EntityDirectionEditor;
	public:
		DirectionJig(AcDbEntity* pEntity, const AcGePoint3d& basePt, AcGePoint3dArray& PointArray,
			const AcGeVector3d& pipeDir = AcGeVector3d(0,1,0),
			const AcGeVector3d& InitVector = AcGeVector3d(0,0,1),
			const FreeField& field = FreeField());
		virtual ~DirectionJig();
		
	public:
		BOOL dolt();
		virtual AcDbEntity* entity() const;
		virtual Adesk::Boolean update();
		virtual AcEdJig::DragStatus sampler();

		const AcGeVector3d& Direction(){
			return m_vDir;
		}

		const AcGeMatrix3d& TransMatrix() const {
			return m_Editor.TransMatrix();
		}
	private:
		Acad::ErrorStatus transformOsnapBy();

	private:
		AcDbEntity* m_pEntity;
		EntityDirectionEditor m_Editor;
		AcGePoint3d m_basePoint;
		AcGePoint3d m_MousePoint;
		AcGeVector3d m_InitVector;
		AcGeVector3d m_PipeDir;
		AcGePoint3d m_LastPoint;
		AcGeMatrix3d m_matrix;
		AcGeVector3d m_vDir;
		AcGePoint3dArray& m_OsnapPtArray;
		FreeField m_field;
	};
}
#endif // !defined(AFX_DIRECTIONJIG_H__69DDFEEF_EE8A_46E3_BDFA_CB6DDAD9D3F8__INCLUDED_)
